import { IndexAnchor } from "vant";
import Vue from "vue";
import Router from "vue-router";
import Index from "../pages/index.vue";

Vue.use(Router);

export default new Router({
  mode: "hash",
  routes: [
    {
      path: "/",
      name: "Index",
      component: Index,
      children: [
        {
          path: "",
          name: "Home",
          component: () => import("@/pages/home/home")
        },
        {
          path: "/category",
          name: "Category",
          component: () => import("@/pages/category/category")
        },
        {
          path: "/cart",
          name: "Cart",
          component: () => import("@/pages/cart/cart")
        },
        {
          path: "/mine",
          name: "Mine",
          component: () => import("@/pages/mine/mine")
        }
      ]
    },
    {
      path: '/search',
      name: 'Search',
      component: () => import('@/pages/search/search')
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/pages/login/login')
    }
  ]
});
